package com.bookyourtrek.action;

import java.math.BigInteger;
import java.util.Map;

import com.bookyourtrek.model.OrderModel;
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport;

public class PaymentViaCODAction extends ActionSupport{

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	@SuppressWarnings("rawtypes")
	public String paymentviacod() {
		Map sess=ActionContext.getContext().getSession();
		//System.out.println(sess.get("orderid"));
		if(sess.get("orderid") == null) {
			return INPUT;
		}
		
		//update order table
		OrderModel om = new OrderModel();
		om.confirmPayment((BigInteger) sess.get("orderid"));
		
		//send mail to user
		
        sess.remove("orderid");
		return SUCCESS;
	}
}
